From: Juergen Gross Date: Thu, 27 Oct 2016 09:55:52 +0000 (+0200) Subject: xenstore: fix add_change_node() X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~139 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=dc6d67804fbf043e53f8f7805c7a39b279a47f5a;p=xen.git xenstore: fix add_change_node() add_change_node() in xenstored is used to add a modified node to the list of changed nodes of one transaction. It is being called with the recurse parameter set to true when removing a node in order to get watches for children of the node fired at transaction end, too. If, however, the node to be deleted had been modified in the same transaction the recurse parameter of add_change_node() is lost as an entry already in the list of the changed nodes won't be entered again. Signed-off-by: Juergen Gross Reviewed-by: Wei Liu Release-acked-by: Wei Liu --- diff --git a/tools/xenstore/xenstored_transaction.c b/tools/xenstore/xenstored_transaction.c index 34720fa6d4..84cb0bfac5 100644 --- a/tools/xenstore/xenstored_transaction.c +++ b/tools/xenstore/xenstored_transaction.c @@ -102,9 +102,13 @@ void add_change_node(struct transaction *trans, const char *node, bool recurse) return; } - list_for_each_entry(i, &trans->changes, list) - if (streq(i->node, node)) + list_for_each_entry(i, &trans->changes, list) { + if (streq(i->node, node)) { + if (recurse) + i->recurse = recurse; return; + } + } i = talloc(trans, struct changed_node); i->node = talloc_strdup(i, node);